Skip to content

Conversation

@parameja1
Copy link
Contributor

@parameja1 parameja1 commented Jul 29, 2025

Problem

In order to set appropriate Origin Info on LSP side for SMUS CodeEditor, link, clientInfo needs to be distinct and with current logic that uses vscode.env.appName whose value will be same for all sagemaker codeeditor instances

Solution

  • To check if the environment is SageMaker and a Unified Studio instance and set corresponding clientInfo Name which is AmazonQ-For-SMUS-CE

Testing

  • Built artefact locally using npm run compile && npm run package and tested on a SMUS CE space
  • LSP logs are attached to show the respective client Info details
[Trace - 9:55:46 PM] Sending request 'initialize - (0)'.
Params: {
    "processId": 6395,
    "clientInfo": {
        "name": "vscode",
        "version": "1.90.1"
    },
....
"initializationOptions": {
        "aws": {
            "clientInfo": {
                "name": "AmazonQ-For-SMUS-CE",
                "version": "1.90.1",
                "extension": {
                    "name": "AmazonQ-For-VSCode",
.....
  • Tested the debug artefact in SMUS and SMAI spaces

As observed below, the sign out was only disabled for SMUS case initially with this change, a CR followed up which overrode the logic in isSageMaker and returned true for all cases irrespective of the appName passed

SMUS

image

SMAI

image
  • Observing Q sendMessage failure in SMAI CE instance due to missing permissions, again unrelated to this change

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@parameja1 parameja1 requested a review from a team as a code owner July 29, 2025 22:27
@github-actions
Copy link

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.
  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

* Returns default value of vscode appName or AmazonQ-For-SMUS-CE in case of a sagemaker unified studio environment
*/
export function getClientName() {
if (isSageMaker() && isSageMakerUnifiedStudio()) {
Copy link

@sdharani91 sdharani91 Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Why do we need both these conditions?
  2. Note that in flare code, the clientInfo check is for a top level field. So we will need to modify that to also check for clientInfo under aws in initialializationOptions.

Copy link
Contributor Author

@parameja1 parameja1 Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. isSageMaker logic is such that it returns true for a SageMaker environment, hence it will be true for both SMAI and SMUS case, added additional check for SMUS to not affect SMAI
  2. Ack, will make the change to also refer the clientInfo under aws field

@parameja1
Copy link
Contributor Author

Test Failures above observed in EcsCredentialsProvider unit tests isnt related to the above changes

@parameja1 parameja1 requested a review from sdharani91 August 1, 2025 19:21
@laileni-aws laileni-aws merged commit d3e1e4f into aws:master Aug 4, 2025
20 of 25 checks passed
parameja1 added a commit to parameja1/aws-toolkit-vscode that referenced this pull request Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants